package com.slorgs.infrastructure.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

@TableName(value = "ams_user")
public class User {
    @TableId("idUser")
    public String idUser;

    @TableField("realName")
    public String realName;

    @TableField("loginName")
    public String loginName;

    @TableField("password")
    public String password;

    @TableField("telephone")
    public String telephone;

    @TableField("mail")
    public String mail;

    @TableField("role")
    public String role;

    @TableField("status")
    public String status;

    @TableField("createBy")
    public String createBy;

    @TableField("createTime")
    public Date createTime;

    @TableField("updateBy")
    public String updateBy;

    @TableField("updateTime")
    public Date updateTime;

    public User(String idUser, String realName, String loginName, String password, String telephone, String mail, String role, String status, String createBy, Date createTime, String updateBy, Date updateTime) {
        this.idUser = idUser;
        this.realName = realName;
        this.loginName = loginName;
        this.password = password;
        this.telephone = telephone;
        this.mail = mail;
        this.role = role;
        this.status = status;
        this.createBy = createBy;
        this.createTime = createTime;
        this.updateBy = updateBy;
        this.updateTime = updateTime;
    }

    public static UserBuilder builder(){
        return new UserBuilder();
    }

    public User() {
    }

    public static class UserBuilder {
        public String idUser;
        public String realName;
        public String loginName;
        public String password;
        public String telephone;
        public String mail;
        public String role;
        public String status;
        public String createBy;
        public Date createTime;
        public String updateBy;
        public Date updateTime;

        public UserBuilder idUser(String idUser) {
            this.idUser = idUser;
            return this;
        }

        public UserBuilder realName(String realName) {
            this.realName = realName;
            return this;
        }

        public UserBuilder loginName(String loginName) {
            this.loginName = loginName;
            return this;
        }

        public UserBuilder password(String password) {
            this.password = password;
            return this;
        }

        public UserBuilder telephone(String telephone) {
            this.telephone = telephone;
            return this;
        }

        public UserBuilder mail(String mail) {
            this.mail = mail;
            return this;
        }

        public UserBuilder role(String role) {
            this.role = role;
            return this;
        }

        public UserBuilder status(String status) {
            this.status = status;
            return this;
        }

        public UserBuilder createBy(String createBy) {
            this.createBy = createBy;
            return this;
        }

        public UserBuilder createTime(Date createTime) {
            this.createTime = createTime;
            return this;
        }

        public UserBuilder updateBy(String updateBy) {
            this.updateBy = updateBy;
            return this;
        }

        public UserBuilder updateTime(Date updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public User build() {
            return new User(this.idUser, this.realName, this.loginName, this.password, this.telephone, this.mail, this.role
                    , this.status, this.createBy, this.createTime, this.updateBy, this.updateTime);
        }
    }
}
